<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
	<link rel="P3Pv1" href="http://www.w3.org/2001/05/P3P/p3p.xml"></link>
	 <meta http-equiv="P3P" content='CP="CAO PSA IDC DSP COR CURa ADMa  OUR IND PHY ONL COM STA"'>
    <title>Welcome to sharesso!</title>
    <script type='text/javascript'>
	
        window.onload = function(){
            delCookie("authorizationToken");
            var operation = getQueryString("operation");
            var authorizationToken = getQueryString("authorizationToken");
            if("in" == operation || "refresh" == operation){
                setCookie("authorizationToken",authorizationToken);
            }
            else if("out" == operation){
                delCookie("authorizationToken");
            }
            function getQueryString(name) {
                var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
                var r = window.location.search.substr(1).match(reg);
                if (r != null) return unescape(r[2]);
                return null;
            }

            //写cookies
            function setCookie(name,value,days)//两个参数，一个是cookie的名子，一个是值
            {
                var exp  = new Date();
                exp.setTime(exp.getTime() + days*24*60*60*1000);
                document.cookie = name + "="+ escape (value) + ";path=/;expires=" + exp.toGMTString();
            }

            function setCookie(name,value)//两个参数，一个是cookie的名子，一个是值
            {
                var exp  = new Date();
                exp.setTime(exp.getTime() + 15*24*60*60*1000);
                document.cookie = name + "="+ escape (value) + ";path=/;expires=" + exp.toGMTString();
                localStorage.setItem(name,value)
            }

            function getCookie(name)//取cookies函数
            {
                var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
                if(arr != null) {
                    return unescape(arr[2]);
                }else{
                    return null;
                }
            }
            function notEmpty(p) {
                if (p == undefined || p == null ||  p == '' || p == 'null'  || p == 'undefined') {
                    return false;
                } else {
                    return true;
                }
            }
            function delCookie(name)//删除cookie
            {
                var exp = new Date();
                exp.setTime(exp.getTime() - 1);
                var cval=getCookie(name);
                if(cval!=null) document.cookie= name + "="+cval+";path=/;expires="+exp.toGMTString();
                localStorage.removeItem(name);
            }
        }
   </script>
</head>
<body>
<h1>sharesso</h1>
</body>
</html>
